package companyuser;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.wipz.eoa.iphone.BaseServiceImpl;

public class UserServiceImpl extends BaseServiceImpl implements IUserService {

	@Override
	public List<User> getUserListByGroupid(String groupid) {
		Map<Object,Object> userMap = new HashMap<Object,Object>();
		userMap.put("GROUPID",groupid);
		List<User> companyuserlist=new ArrayList<User>();
		List<Map> agencyByBusinessList = super.queryList("companyuser.query", userMap);
		for (Map currentAgencyMap : agencyByBusinessList){
			User u=new User();
			try{
				u.setId((String)currentAgencyMap.get("ID"));
				u.setAge((String)currentAgencyMap.get("AGE"));
				u.setBirthday(new Date());
				u.setEmail((String)currentAgencyMap.get("EMAIL"));
				u.setFullname((String)currentAgencyMap.get("FULLNAME"));
				u.setGroupid(groupid);
				u.setIntroduction((String)currentAgencyMap.get("INTRODUCTION"));
				u.setIs_deleted((String)currentAgencyMap.get("IS_DELETE"));
				companyuserlist.add(u);
			}catch(Exception e){
				e.printStackTrace();
			}
		}
		return companyuserlist;
	}
}
